class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: B = None
        self.x: G = None
        self.q: B = None
        self.u: D = None
        self.z: E = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: G = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: B = None
        self.q: B = None
        self.t: A = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: G = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: B = None
        self.q: B = None
        self.t: A = None
        self.v: C = None
        self.txt = txt

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

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

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