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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.t: D = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: E = None
        self.p: G = None
        self.u: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.t: D = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: E = None
        self.p: G = None
        self.u: B = None
        self.txt = txt

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

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