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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: C = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: C = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.w: F = None
        self.txt = txt

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

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