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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: F = None
        self.w: E = None
        self.y: A = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: B = None
        self.y: F = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: D = None
        self.txt = txt

b = A("b")
f = B("f")
a = C("a")
g = D("g")
d = E("d")
j = F("j")

b.t = a
b.w = g
b.u = g
f.q = g
f.x = b
f.t = a
a.w = g
a.z = g
a.t = g
a.s = j
a.x = d
g.v = f
g.p = j
g.o = j
g.w = d
g.y = b
d.t = j
d.y = j
d.r = f
d.u = g
j.o = d
j.r = g
assert f.q.w.t.o.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.u: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: F = None
        self.w: E = None
        self.y: A = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: B = None
        self.y: F = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: D = None
        self.txt = txt

b = A("b")
f = B("f")
a = C("a")
g = D("g")
d = E("d")
j = F("j")

b.t = a
b.w = g
b.u = g
f.q = g
f.x = b
f.t = a
a.w = g
a.z = g
a.t = g
a.s = j
a.x = d
g.v = f
g.p = j
g.o = j
g.w = d
g.y = b
d.t = j
d.y = j
d.r = f
d.u = g
j.o = d
j.r = g
assert f.q.w.t.o.u.y.txt == "b"