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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: B = None
        self.z: E = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.r: J = None
        self.u: B = None
        self.q: I = None
        self.z: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: A = None
        self.s: D = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: B = None
        self.z: E = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.r: J = None
        self.u: B = None
        self.q: I = None
        self.z: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: A = None
        self.s: D = None
        self.p: D = None
        self.txt = txt

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

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