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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: D = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: A = None
        self.z: F = None
        self.p: F = None
        self.txt = txt

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

k = A("k")
b = B("b")
n = C("n")
m = D("m")
e = E("e")
c = F("c")
h = F("h")
g = E("g")
l = B("l")

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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: D = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: A = None
        self.z: F = None
        self.p: F = None
        self.txt = txt

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

k = A("k")
b = B("b")
n = C("n")
m = D("m")
e = E("e")
c = F("c")
h = F("h")
g = E("g")
l = B("l")

k.t = c
k.r = n
b.s = l
b.w = m
b.v = n
n.z = b
m.w = k
m.q = g
e.x = l
e.u = k
e.z = c
e.p = h
c.o = k
c.s = k
c.z = m
c.v = m
h.o = k
h.s = k
h.z = m
h.v = m
g.x = l
g.u = k
g.z = c
g.p = c
l.s = b
l.w = m
l.v = n
assert h.s.r.z.s.s.v.z.txt == "b"