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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: B = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: A = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.r: B = None
        self.s: E = None
        self.q: J = None
        self.x: C = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: F = None
        self.x: B = None
        self.o: D = None
        self.q: C = None
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: E = None
        self.w: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: A = None
        self.r: C = None
        self.q: H = None
        self.x: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: B = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: A = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.r: B = None
        self.s: E = None
        self.q: J = None
        self.x: C = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: F = None
        self.x: B = None
        self.o: D = None
        self.q: C = None
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: E = None
        self.w: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: A = None
        self.r: C = None
        self.q: H = None
        self.x: E = None
        self.txt = txt

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

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