class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: F = None
        self.o: E = None
        self.q: E = None
        self.x: H = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.x: D = None
        self.q: B = None
        self.s: J = None
        self.p: E = None
        self.o: I = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: J = None
        self.v: A = None
        self.o: I = None
        self.t: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: E = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: G = None
        self.t: E = None
        self.p: J = None
        self.u: G = None
        self.y: D = None
        self.v: F = None
        self.w: D = None
        self.s: J = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: J = None
        self.y: A = None
        self.z: E = None
        self.s: C = None
        self.w: A = None
        self.u: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.x: D = None
        self.q: B = None
        self.s: J = None
        self.p: E = None
        self.o: I = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: J = None
        self.v: A = None
        self.o: I = None
        self.t: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: E = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: G = None
        self.t: E = None
        self.p: J = None
        self.u: G = None
        self.y: D = None
        self.v: F = None
        self.w: D = None
        self.s: J = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: J = None
        self.y: A = None
        self.z: E = None
        self.s: C = None
        self.w: A = None
        self.u: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.txt = txt

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

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