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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: F = None
        self.p: C = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

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

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

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

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

b = A("b")
k = B("k")
m = C("m")
e = D("e")
c = E("c")
a = F("a")
d = F("d")
l = B("l")

b.z = d
b.t = m
k.q = a
k.o = a
k.p = m
k.r = m
k.w = l
m.v = b
m.t = b
e.q = k
e.o = m
e.r = l
e.v = a
c.x = e
a.v = c
a.x = d
a.s = e
d.v = c
d.x = a
d.s = e
l.q = a
l.o = a
l.p = m
l.r = m
l.w = k
assert l.p.t.z.s.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: F = None
        self.p: C = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

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

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

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

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

b = A("b")
k = B("k")
m = C("m")
e = D("e")
c = E("c")
a = F("a")
d = F("d")
l = B("l")

b.z = d
b.t = m
k.q = a
k.o = a
k.p = m
k.r = m
k.w = l
m.v = b
m.t = b
e.q = k
e.o = m
e.r = l
e.v = a
c.x = e
a.v = c
a.x = d
a.s = e
d.v = c
d.x = a
d.s = e
l.q = a
l.o = a
l.p = m
l.r = m
l.w = k
assert l.p.t.z.s.o.v.txt == "b"