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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: A = None
        self.o: D = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = 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.s: A = None
        self.o: F = None
        self.y: D = None
        self.txt = txt

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

l.p = c
a.t = l
a.v = l
a.o = i
a.q = i
g.z = k
g.o = k
g.r = h
g.x = i
i.s = k
d.o = k
d.s = k
h.z = l
c.s = l
c.o = h
c.y = i
k.z = g
k.o = g
k.r = h
k.x = i
b.t = l
b.v = l
b.o = i
b.q = i
f.t = l
f.v = l
f.o = i
f.q = i
assert b.t.p.s.p.o.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: A = None
        self.o: D = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = 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.s: A = None
        self.o: F = None
        self.y: D = None
        self.txt = txt

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

l.p = c
a.t = l
a.v = l
a.o = i
a.q = i
g.z = k
g.o = k
g.r = h
g.x = i
i.s = k
d.o = k
d.s = k
h.z = l
c.s = l
c.o = h
c.y = i
k.z = g
k.o = g
k.r = h
k.x = i
b.t = l
b.v = l
b.o = i
b.q = i
f.t = l
f.v = l
f.o = i
f.q = i
assert b.t.p.s.p.o.z.p.txt == "c"