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

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

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

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

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

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

l = A("l")
b = B("b")
n = C("n")
m = D("m")
j = E("j")
d = F("d")
e = E("e")

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

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

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

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

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

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

l = A("l")
b = B("b")
n = C("n")
m = D("m")
j = E("j")
d = F("d")
e = E("e")

l.s = m
l.u = n
l.t = b
l.x = b
l.w = d
b.q = l
b.r = l
b.z = m
b.p = n
n.y = b
n.r = j
n.w = e
m.z = j
m.o = e
j.z = d
j.y = e
d.x = j
d.y = j
e.z = d
e.y = j
assert d.y.z.x.y.z.txt == "d"