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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: A = None
        self.z: D = None
        self.y: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: A = None
        self.z: D = None
        self.y: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: G = None
        self.txt = txt

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

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

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

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