class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: A = None
        self.o: E = None
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

m = A("m")
l = B("l")
b = C("b")
d = D("d")
g = E("g")
a = F("a")
c = G("c")
i = G("i")
f = A("f")
n = B("n")

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

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

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

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

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

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

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

m = A("m")
l = B("l")
b = C("b")
d = D("d")
g = E("g")
a = F("a")
c = G("c")
i = G("i")
f = A("f")
n = B("n")

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