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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: F = None
        self.p: C = None
        self.y: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: G = None
        self.y: B = None
        self.t: F = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.u: A = None
        self.t: B = None
        self.txt = txt

i = A("i")
h = B("h")
b = C("b")
m = D("m")
j = E("j")
d = F("d")
k = G("k")
c = C("c")
e = C("e")
l = F("l")

i.r = h
h.v = i
h.r = d
h.p = b
h.y = m
b.p = i
m.u = j
m.q = j
m.y = k
j.o = l
d.q = i
d.s = i
d.v = k
d.y = h
d.t = l
k.x = m
k.z = h
k.t = h
k.u = i
c.p = i
e.p = i
l.q = i
l.s = i
l.v = k
l.y = h
l.t = d
assert e.p.r.r.t.q.r.y.y.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: F = None
        self.p: C = None
        self.y: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: G = None
        self.y: B = None
        self.t: F = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.u: A = None
        self.t: B = None
        self.txt = txt

i = A("i")
h = B("h")
b = C("b")
m = D("m")
j = E("j")
d = F("d")
k = G("k")
c = C("c")
e = C("e")
l = F("l")

i.r = h
h.v = i
h.r = d
h.p = b
h.y = m
b.p = i
m.u = j
m.q = j
m.y = k
j.o = l
d.q = i
d.s = i
d.v = k
d.y = h
d.t = l
k.x = m
k.z = h
k.t = h
k.u = i
c.p = i
e.p = i
l.q = i
l.s = i
l.v = k
l.y = h
l.t = d
assert e.p.r.r.t.q.r.y.y.u.r.txt == "h"