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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: F = None
        self.s: G = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: C = None
        self.t: I = None
        self.r: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: G = None
        self.x: G = None
        self.v: C = None
        self.y: E = None
        self.p: D = None
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: B = None
        self.u: D = None
        self.s: B = None
        self.v: I = None
        self.p: I = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: F = None
        self.s: G = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: C = None
        self.t: I = None
        self.r: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: G = None
        self.x: G = None
        self.v: C = None
        self.y: E = None
        self.p: D = None
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: B = None
        self.u: D = None
        self.s: B = None
        self.v: I = None
        self.p: I = None
        self.q: B = None
        self.txt = txt

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

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