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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: C = None
        self.q: C = None
        self.z: F = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.u: G = None
        self.r: G = None
        self.o: A = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: D = None
        self.z: D = None
        self.txt = txt

d = A("d")
i = B("i")
g = C("g")
c = D("c")
n = E("n")
j = F("j")
b = G("b")
l = D("l")
a = C("a")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: C = None
        self.q: C = None
        self.z: F = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.u: G = None
        self.r: G = None
        self.o: A = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: D = None
        self.z: D = None
        self.txt = txt

d = A("d")
i = B("i")
g = C("g")
c = D("c")
n = E("n")
j = F("j")
b = G("b")
l = D("l")
a = C("a")

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