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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.r: D = None
        self.w: B = None
        self.s: D = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: F = None
        self.p: B = None
        self.txt = txt

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

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

f.r = l
i.z = c
i.q = c
i.w = c
i.r = l
i.s = l
i.x = d
k.o = d
k.w = d
k.y = l
k.t = l
l.v = a
l.y = a
g.o = k
g.y = a
g.p = c
a.t = k
a.r = l
a.u = l
a.z = l
a.p = i
a.s = g
d.r = l
n.o = f
n.w = f
n.y = l
n.t = l
c.z = i
c.q = i
c.w = i
c.r = l
c.s = l
c.x = d
e.o = n
e.y = a
e.p = i
assert e.p.r.v.t.o.r.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.r: D = None
        self.w: B = None
        self.s: D = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: F = None
        self.p: B = None
        self.txt = txt

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

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

f.r = l
i.z = c
i.q = c
i.w = c
i.r = l
i.s = l
i.x = d
k.o = d
k.w = d
k.y = l
k.t = l
l.v = a
l.y = a
g.o = k
g.y = a
g.p = c
a.t = k
a.r = l
a.u = l
a.z = l
a.p = i
a.s = g
d.r = l
n.o = f
n.w = f
n.y = l
n.t = l
c.z = i
c.q = i
c.w = i
c.r = l
c.s = l
c.x = d
e.o = n
e.y = a
e.p = i
assert e.p.r.v.t.o.r.v.p.txt == "i"