class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.x: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: F = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: F = None
        self.o: E = None
        self.r: A = None
        self.p: E = None
        self.v: A = None
        self.txt = txt

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

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

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

b.o = f
b.p = j
i.y = j
i.s = n
i.x = m
a.y = b
a.q = k
a.x = e
n.t = j
n.w = h
n.o = f
n.p = f
n.r = b
n.v = b
f.x = e
e.w = a
h.w = a
k.w = a
m.y = n
m.s = j
m.x = i
j.t = n
j.w = k
j.o = f
j.p = f
j.r = b
j.v = b
assert i.s.w.w.x.w.y.p.t.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.x: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: F = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: F = None
        self.o: E = None
        self.r: A = None
        self.p: E = None
        self.v: A = None
        self.txt = txt

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

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

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

b.o = f
b.p = j
i.y = j
i.s = n
i.x = m
a.y = b
a.q = k
a.x = e
n.t = j
n.w = h
n.o = f
n.p = f
n.r = b
n.v = b
f.x = e
e.w = a
h.w = a
k.w = a
m.y = n
m.s = j
m.x = i
j.t = n
j.w = k
j.o = f
j.p = f
j.r = b
j.v = b
assert i.s.w.w.x.w.y.p.t.w.w.txt == "a"