class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: E = None
        self.p: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

l = A("l")
n = B("n")
b = C("b")
m = D("m")
j = E("j")
f = F("f")
c = C("c")
i = E("i")
k = C("k")

l.y = k
l.s = k
l.u = j
l.p = j
n.w = l
n.t = b
n.z = c
n.u = m
b.z = c
b.q = f
m.x = c
j.y = i
j.s = m
j.z = m
j.v = c
f.s = m
c.z = k
c.q = f
i.y = j
i.s = m
i.z = m
i.v = k
k.z = c
k.q = f
assert l.s.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: E = None
        self.p: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

l = A("l")
n = B("n")
b = C("b")
m = D("m")
j = E("j")
f = F("f")
c = C("c")
i = E("i")
k = C("k")

l.y = k
l.s = k
l.u = j
l.p = j
n.w = l
n.t = b
n.z = c
n.u = m
b.z = c
b.q = f
m.x = c
j.y = i
j.s = m
j.z = m
j.v = c
f.s = m
c.z = k
c.q = f
i.y = j
i.s = m
i.z = m
i.v = k
k.z = c
k.q = f
assert l.s.q.s.txt == "m"