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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.r: E = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.v: A = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.p: D = None
        self.w: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.r: E = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.v: A = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.p: D = None
        self.w: C = None
        self.txt = txt

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

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

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