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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: E = None
        self.y: D = None
        self.w: H = None
        self.o: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: G = None
        self.y: B = None
        self.w: D = None
        self.p: H = None
        self.z: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: E = None
        self.y: D = None
        self.w: H = None
        self.o: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: G = None
        self.y: B = None
        self.w: D = None
        self.p: H = None
        self.z: G = None
        self.txt = txt

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

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

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

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