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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: G = None
        self.u: C = None
        self.y: C = None
        self.p: I = None
        self.z: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: J = None
        self.x: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: G = None
        self.u: C = None
        self.y: C = None
        self.p: I = None
        self.z: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: J = None
        self.x: A = None
        self.txt = txt

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

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

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