class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: C = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: A = None
        self.t: C = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: E = None
        self.u: B = None
        self.z: G = None
        self.x: A = None
        self.txt = txt

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

b.t = j
b.y = d
b.w = f
i.q = j
i.z = b
i.t = d
i.w = f
d.z = e
d.y = e
d.o = e
d.t = l
d.u = b
d.s = b
d.x = m
e.w = d
e.t = m
l.z = e
m.u = j
f.q = l
f.o = i
j.v = l
j.w = l
j.u = i
j.z = f
j.x = b
assert b.y.t.z.t.u.z.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: C = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: A = None
        self.t: C = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: E = None
        self.u: B = None
        self.z: G = None
        self.x: A = None
        self.txt = txt

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

b.t = j
b.y = d
b.w = f
i.q = j
i.z = b
i.t = d
i.w = f
d.z = e
d.y = e
d.o = e
d.t = l
d.u = b
d.s = b
d.x = m
e.w = d
e.t = m
l.z = e
m.u = j
f.q = l
f.o = i
j.v = l
j.w = l
j.u = i
j.z = f
j.x = b
assert b.y.t.z.t.u.z.o.q.txt == "j"