class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: B = None
        self.y: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

n = A("n")
h = B("h")
m = C("m")
g = D("g")
k = E("k")
e = F("e")
b = A("b")
f = B("f")

n.t = k
n.o = h
n.q = h
n.y = e
h.z = e
h.o = f
m.z = e
g.s = e
k.x = m
e.p = g
e.q = h
e.x = h
b.t = k
b.o = h
b.y = e
b.q = f
f.z = e
f.o = h
assert f.o.o.z.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: B = None
        self.y: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

n = A("n")
h = B("h")
m = C("m")
g = D("g")
k = E("k")
e = F("e")
b = A("b")
f = B("f")

n.t = k
n.o = h
n.q = h
n.y = e
h.z = e
h.o = f
m.z = e
g.s = e
k.x = m
e.p = g
e.q = h
e.x = h
b.t = k
b.o = h
b.y = e
b.q = f
f.z = e
f.o = h
assert f.o.o.z.p.s.txt == "e"