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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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