class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: F = None
        self.o: D = None
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: F = None
        self.o: D = None
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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