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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: E = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: H = None
        self.q: I = None
        self.p: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.w: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: C = None
        self.p: E = None
        self.u: B = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: E = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: H = None
        self.q: I = None
        self.p: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.w: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: C = None
        self.p: E = None
        self.u: B = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

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

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

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