class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: B = None
        self.w: D = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: E = None
        self.o: D = None
        self.u: D = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: H = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: H = None
        self.w: A = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: D = None
        self.x: B = None
        self.z: A = None
        self.w: D = None
        self.txt = txt

j = A("j")
d = B("d")
l = C("l")
e = D("e")
c = E("c")
k = F("k")
b = G("b")
f = H("f")

j.r = c
j.q = d
j.w = e
j.z = f
d.v = e
d.o = e
d.u = e
d.p = c
d.q = l
l.w = b
l.s = k
e.q = j
e.w = f
e.y = f
c.u = b
k.q = d
k.x = l
k.u = l
k.p = b
k.t = b
b.t = k
b.v = f
b.u = f
b.w = j
f.v = k
f.q = e
f.w = e
f.x = d
f.z = j
assert b.t.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: B = None
        self.w: D = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: E = None
        self.o: D = None
        self.u: D = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: H = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: H = None
        self.w: A = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: D = None
        self.x: B = None
        self.z: A = None
        self.w: D = None
        self.txt = txt

j = A("j")
d = B("d")
l = C("l")
e = D("e")
c = E("c")
k = F("k")
b = G("b")
f = H("f")

j.r = c
j.q = d
j.w = e
j.z = f
d.v = e
d.o = e
d.u = e
d.p = c
d.q = l
l.w = b
l.s = k
e.q = j
e.w = f
e.y = f
c.u = b
k.q = d
k.x = l
k.u = l
k.p = b
k.t = b
b.t = k
b.v = f
b.u = f
b.w = j
f.v = k
f.q = e
f.w = e
f.x = d
f.z = j
assert b.t.x.w.txt == "b"