class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: F = None
        self.v: E = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: B = None
        self.p: A = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: D = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

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

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

i.r = b
i.s = b
i.o = g
i.v = f
b.o = k
a.u = l
d.s = a
d.u = b
d.p = i
d.q = g
f.o = l
f.y = d
f.x = a
f.w = i
g.q = d
g.s = a
l.q = d
l.s = a
k.s = a
k.u = b
k.p = i
k.q = l
assert g.q.p.o.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: F = None
        self.v: E = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: B = None
        self.p: A = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: D = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

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

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

i.r = b
i.s = b
i.o = g
i.v = f
b.o = k
a.u = l
d.s = a
d.u = b
d.p = i
d.q = g
f.o = l
f.y = d
f.x = a
f.w = i
g.q = d
g.s = a
l.q = d
l.s = a
k.s = a
k.u = b
k.p = i
k.q = l
assert g.q.p.o.q.q.q.q.txt == "g"