class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.s: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: E = None
        self.r: J = None
        self.z: B = None
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: D = None
        self.r: A = None
        self.w: A = None
        self.o: F = None
        self.s: C = None
        self.y: F = None
        self.u: H = None
        self.x: I = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: H = None
        self.y: D = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: C = None
        self.s: F = None
        self.y: A = None
        self.o: B = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.s: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: E = None
        self.r: J = None
        self.z: B = None
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: D = None
        self.r: A = None
        self.w: A = None
        self.o: F = None
        self.s: C = None
        self.y: F = None
        self.u: H = None
        self.x: I = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: H = None
        self.y: D = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: C = None
        self.s: F = None
        self.y: A = None
        self.o: B = None
        self.q: D = None
        self.txt = txt

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

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