class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.t: B = None
        self.w: G = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: B = None
        self.u: G = None
        self.t: F = None
        self.o: F = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.p: B = None
        self.y: H = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: E = None
        self.s: F = None
        self.v: I = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.t: B = None
        self.w: G = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: B = None
        self.u: G = None
        self.t: F = None
        self.o: F = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.p: B = None
        self.y: H = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: E = None
        self.s: F = None
        self.v: I = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: H = None
        self.txt = txt

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

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