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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: E = None
        self.u: I = None
        self.z: H = None
        self.x: C = None
        self.t: A = None
        self.y: B = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: E = None
        self.v: I = None
        self.o: F = None
        self.w: I = None
        self.x: I = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: B = None
        self.t: I = None
        self.y: B = None
        self.p: C = None
        self.v: F = None
        self.w: D = None
        self.x: G = None
        self.txt = txt

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

a = A("a")
h = B("h")
m = C("m")
i = D("i")
j = E("j")
n = F("n")
b = G("b")
c = H("c")
l = I("l")
k = E("k")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: E = None
        self.u: I = None
        self.z: H = None
        self.x: C = None
        self.t: A = None
        self.y: B = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: E = None
        self.v: I = None
        self.o: F = None
        self.w: I = None
        self.x: I = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: B = None
        self.t: I = None
        self.y: B = None
        self.p: C = None
        self.v: F = None
        self.w: D = None
        self.x: G = None
        self.txt = txt

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

a = A("a")
h = B("h")
m = C("m")
i = D("i")
j = E("j")
n = F("n")
b = G("b")
c = H("c")
l = I("l")
k = E("k")

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