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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

l = A("l")
b = B("b")
n = C("n")
d = D("d")
g = E("g")
f = F("f")

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

l = A("l")
b = B("b")
n = C("n")
d = D("d")
g = E("g")
f = F("f")

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