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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: H = None
        self.w: F = None
        self.z: E = None
        self.p: E = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.w: D = None
        self.v: D = None
        self.u: G = None
        self.y: D = None
        self.s: E = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: B = None
        self.v: C = None
        self.z: G = None
        self.w: B = None
        self.p: B = None
        self.y: G = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: H = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: H = None
        self.w: F = None
        self.z: E = None
        self.p: E = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.w: D = None
        self.v: D = None
        self.u: G = None
        self.y: D = None
        self.s: E = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: B = None
        self.v: C = None
        self.z: G = None
        self.w: B = None
        self.p: B = None
        self.y: G = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: H = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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