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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: C = None
        self.o: C = None
        self.u: D = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: C = None
        self.o: C = None
        self.u: D = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

m.s = l
j.v = h
j.r = h
j.p = c
j.o = c
j.u = f
j.t = l
h.o = m
h.q = m
h.v = k
h.x = k
h.z = c
h.r = f
f.s = j
f.w = h
f.r = k
l.y = f
l.u = f
k.r = h
k.w = h
k.y = m
k.u = j
c.o = m
c.q = m
c.v = k
c.x = k
c.z = h
c.r = f
assert h.r.r.r.txt == "h"