class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: D = None
        self.v: F = None
        self.w: F = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

i = A("i")
c = B("c")
m = C("m")
g = D("g")
f = E("f")
h = F("h")
b = B("b")
e = C("e")

i.v = b
i.q = h
i.p = h
c.v = b
m.u = g
g.o = m
g.z = m
g.x = b
g.p = i
f.z = i
f.u = i
f.t = i
f.p = g
f.v = h
f.w = h
h.v = i
h.x = i
b.v = c
e.u = g
assert b.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: D = None
        self.v: F = None
        self.w: F = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

i = A("i")
c = B("c")
m = C("m")
g = D("g")
f = E("f")
h = F("h")
b = B("b")
e = C("e")

i.v = b
i.q = h
i.p = h
c.v = b
m.u = g
g.o = m
g.z = m
g.x = b
g.p = i
f.z = i
f.u = i
f.t = i
f.p = g
f.v = h
f.w = h
h.v = i
h.x = i
b.v = c
e.u = g
assert b.v.v.v.v.v.txt == "c"