class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: F = None
        self.y: F = None
        self.z: E = None
        self.s: D = None
        self.t: H = None
        self.r: I = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

m.u = f
m.v = b
m.y = b
m.x = b
m.z = k
m.s = a
m.t = c
m.r = n
f.t = b
j.o = k
j.x = k
j.s = d
a.o = c
a.s = c
a.u = c
a.p = n
a.q = n
a.w = j
a.x = m
a.y = k
a.t = f
a.z = d
k.t = g
k.y = g
k.o = m
k.s = m
k.q = m
k.x = a
k.w = n
k.z = b
k.v = b
b.u = f
d.q = n
d.w = g
c.r = m
n.w = k
n.q = a
g.x = j
assert k.x.u.r.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: F = None
        self.y: F = None
        self.z: E = None
        self.s: D = None
        self.t: H = None
        self.r: I = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

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