class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.t: G = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: E = None
        self.r: B = None
        self.z: F = None
        self.u: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: F = None
        self.o: B = None
        self.txt = txt

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

f.p = b
f.t = b
f.y = d
f.x = l
e.s = b
g.y = l
g.z = d
d.x = b
d.p = m
d.r = e
d.u = e
d.z = l
m.w = b
m.x = g
l.p = b
b.r = e
b.o = e
b.z = l
a.y = l
a.z = d
assert a.y.p.z.p.z.p.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.t: G = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: E = None
        self.r: B = None
        self.z: F = None
        self.u: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: F = None
        self.o: B = None
        self.txt = txt

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

f.p = b
f.t = b
f.y = d
f.x = l
e.s = b
g.y = l
g.z = d
d.x = b
d.p = m
d.r = e
d.u = e
d.z = l
m.w = b
m.x = g
l.p = b
b.r = e
b.o = e
b.z = l
a.y = l
a.z = d
assert a.y.p.z.p.z.p.o.s.txt == "b"