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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: I = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: G = None
        self.x: F = None
        self.r: I = None
        self.y: E = None
        self.z: G = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: B = None
        self.z: I = None
        self.v: E = None
        self.u: A = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: H = None
        self.z: H = None
        self.r: F = None
        self.o: B = None
        self.u: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: I = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: G = None
        self.x: F = None
        self.r: I = None
        self.y: E = None
        self.z: G = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: B = None
        self.z: I = None
        self.v: E = None
        self.u: A = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: H = None
        self.z: H = None
        self.r: F = None
        self.o: B = None
        self.u: E = None
        self.txt = txt

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

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