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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: J = None
        self.p: J = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: J = None
        self.q: J = None
        self.p: A = None
        self.w: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.t: D = None
        self.w: H = None
        self.q: C = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: J = None
        self.p: J = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: J = None
        self.q: J = None
        self.p: A = None
        self.w: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.t: D = None
        self.w: H = None
        self.q: C = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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