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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: G = None
        self.r: D = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: B = None
        self.p: B = None
        self.w: A = None
        self.v: D = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

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

m.p = f
l.v = e
l.w = f
c.s = h
h.t = i
h.z = l
k.x = f
k.z = c
k.p = l
i.t = m
i.o = f
i.r = h
i.u = k
g.u = m
g.s = m
g.o = l
g.p = l
g.z = l
g.w = e
g.v = h
f.u = e
f.s = e
f.o = l
f.p = l
f.z = l
f.w = m
f.v = h
e.p = g
assert c.s.t.o.o.w.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: G = None
        self.r: D = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: B = None
        self.p: B = None
        self.w: A = None
        self.v: D = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

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

m.p = f
l.v = e
l.w = f
c.s = h
h.t = i
h.z = l
k.x = f
k.z = c
k.p = l
i.t = m
i.o = f
i.r = h
i.u = k
g.u = m
g.s = m
g.o = l
g.p = l
g.z = l
g.w = e
g.v = h
f.u = e
f.s = e
f.o = l
f.p = l
f.z = l
f.w = m
f.v = h
e.p = g
assert c.s.t.o.o.w.u.p.txt == "g"