class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: F = None
        self.u: F = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: F = None
        self.x: H = None
        self.o: A = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: A = None
        self.u: A = None
        self.y: B = None
        self.x: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.t: D = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

b = A("b")
a = B("a")
c = C("c")
i = D("i")
d = E("d")
m = F("m")
g = G("g")
j = H("j")
f = E("f")
h = F("h")

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: F = None
        self.x: H = None
        self.o: A = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: A = None
        self.u: A = None
        self.y: B = None
        self.x: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.t: D = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

b = A("b")
a = B("a")
c = C("c")
i = D("i")
d = E("d")
m = F("m")
g = G("g")
j = H("j")
f = E("f")
h = F("h")

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