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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: A = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: A = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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