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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: E = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.o: C = None
        self.txt = txt

a = A("a")
c = B("c")
h = C("h")
k = D("k")
d = E("d")
n = F("n")
m = F("m")
g = F("g")
e = E("e")

a.p = g
a.u = m
a.s = e
c.o = h
c.w = d
c.y = a
c.s = g
h.t = d
h.y = k
k.w = c
d.s = k
d.z = h
n.s = h
n.v = h
n.o = h
m.s = h
m.v = h
m.o = h
g.s = h
g.v = h
g.o = h
e.s = k
e.z = h
assert d.z.y.w.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: E = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.o: C = None
        self.txt = txt

a = A("a")
c = B("c")
h = C("h")
k = D("k")
d = E("d")
n = F("n")
m = F("m")
g = F("g")
e = E("e")

a.p = g
a.u = m
a.s = e
c.o = h
c.w = d
c.y = a
c.s = g
h.t = d
h.y = k
k.w = c
d.s = k
d.z = h
n.s = h
n.v = h
n.o = h
m.s = h
m.v = h
m.o = h
g.s = h
g.v = h
g.o = h
e.s = k
e.z = h
assert d.z.y.w.y.u.txt == "m"