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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: D = None
        self.s: D = None
        self.q: E = None
        self.o: E = None
        self.r: C = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: F = None
        self.y: D = None
        self.s: B = None
        self.u: G = None
        self.q: B = None
        self.p: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: G = None
        self.w: C = None
        self.o: D = None
        self.x: A = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: C = None
        self.v: F = None
        self.q: E = None
        self.txt = txt

d = A("d")
b = B("b")
g = C("g")
i = D("i")
m = E("m")
h = F("h")
n = G("n")
a = F("a")
j = D("j")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: D = None
        self.s: D = None
        self.q: E = None
        self.o: E = None
        self.r: C = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: F = None
        self.y: D = None
        self.s: B = None
        self.u: G = None
        self.q: B = None
        self.p: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: G = None
        self.w: C = None
        self.o: D = None
        self.x: A = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: C = None
        self.v: F = None
        self.q: E = None
        self.txt = txt

d = A("d")
b = B("b")
g = C("g")
i = D("i")
m = E("m")
h = F("h")
n = G("n")
a = F("a")
j = D("j")

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