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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.r: E = None
        self.x: B = None
        self.p: E = None
        self.z: B = None
        self.txt = txt

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

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

i.u = g
i.p = g
i.v = g
i.o = g
i.q = a
e.r = b
c.p = f
f.r = m
f.p = i
f.q = a
m.v = i
m.q = k
m.r = k
m.p = k
m.x = e
m.z = e
g.v = a
a.u = g
a.p = g
a.v = g
a.o = g
a.q = i
k.v = a
k.q = m
k.r = d
k.p = d
k.x = e
k.z = e
b.p = f
d.v = i
d.q = k
d.r = k
d.p = k
d.x = e
d.z = e
assert g.v.q.v.v.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: A = None
        self.p: F = None
        self.v: F = None
        self.o: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.r: E = None
        self.x: B = None
        self.p: E = None
        self.z: B = None
        self.txt = txt

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

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

i.u = g
i.p = g
i.v = g
i.o = g
i.q = a
e.r = b
c.p = f
f.r = m
f.p = i
f.q = a
m.v = i
m.q = k
m.r = k
m.p = k
m.x = e
m.z = e
g.v = a
a.u = g
a.p = g
a.v = g
a.o = g
a.q = i
k.v = a
k.q = m
k.r = d
k.p = d
k.x = e
k.z = e
b.p = f
d.v = i
d.q = k
d.r = k
d.p = k
d.x = e
d.z = e
assert g.v.q.v.v.q.q.txt == "a"