class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: H = None
        self.z: I = None
        self.u: H = None
        self.t: C = None
        self.o: F = None
        self.r: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.z: F = None
        self.u: I = None
        self.v: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: D = None
        self.o: B = None
        self.s: B = None
        self.y: A = None
        self.w: H = None
        self.t: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: F = None
        self.z: F = None
        self.v: H = None
        self.q: E = None
        self.r: G = None
        self.s: B = None
        self.y: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.z: F = None
        self.u: I = None
        self.v: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: D = None
        self.o: B = None
        self.s: B = None
        self.y: A = None
        self.w: H = None
        self.t: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: F = None
        self.z: F = None
        self.v: H = None
        self.q: E = None
        self.r: G = None
        self.s: B = None
        self.y: I = None
        self.txt = txt

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

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