class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: B = None
        self.p: B = None
        self.u: F = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: C = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: E = None
        self.w: C = None
        self.y: A = None
        self.z: C = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: D = None
        self.x: C = None
        self.v: D = None
        self.z: B = None
        self.r: B = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

m = A("m")
j = B("j")
c = C("c")
f = D("f")
g = E("g")
l = F("l")
d = G("d")
n = H("n")

m.q = c
m.w = j
m.p = j
m.u = l
m.o = d
j.v = d
j.y = c
j.w = c
j.q = f
c.y = f
c.z = j
c.o = m
f.s = j
f.t = g
f.o = g
f.w = c
f.z = c
f.y = m
g.s = d
g.p = m
l.t = m
l.q = c
d.y = g
d.q = f
d.v = f
d.x = c
d.z = j
d.r = j
d.u = m
n.s = g
assert m.u.t.p.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: B = None
        self.p: B = None
        self.u: F = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: C = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: E = None
        self.w: C = None
        self.y: A = None
        self.z: C = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: D = None
        self.x: C = None
        self.v: D = None
        self.z: B = None
        self.r: B = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

m = A("m")
j = B("j")
c = C("c")
f = D("f")
g = E("g")
l = F("l")
d = G("d")
n = H("n")

m.q = c
m.w = j
m.p = j
m.u = l
m.o = d
j.v = d
j.y = c
j.w = c
j.q = f
c.y = f
c.z = j
c.o = m
f.s = j
f.t = g
f.o = g
f.w = c
f.z = c
f.y = m
g.s = d
g.p = m
l.t = m
l.q = c
d.y = g
d.q = f
d.v = f
d.x = c
d.z = j
d.r = j
d.u = m
n.s = g
assert m.u.t.p.w.y.txt == "f"