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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.u: D = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: H = None
        self.s: D = None
        self.r: E = None
        self.v: A = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.t: E = None
        self.q: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.u: D = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: H = None
        self.s: D = None
        self.r: E = None
        self.v: A = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.t: E = None
        self.q: F = None
        self.txt = txt

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

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