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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.w: C = None
        self.s: F = None
        self.q: E = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.s: E = None
        self.v: B = None
        self.u: B = None
        self.txt = txt

a = A("a")
l = B("l")
i = C("i")
d = D("d")
b = E("b")
h = F("h")
n = A("n")

a.p = h
a.w = l
l.t = h
l.o = i
l.w = d
i.t = l
i.y = d
d.p = i
d.w = i
d.y = b
d.q = b
d.s = h
d.u = h
b.y = n
h.r = l
h.v = l
h.u = l
h.t = n
h.s = b
n.p = h
n.w = l
assert h.t.w.o.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.w: C = None
        self.s: F = None
        self.q: E = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.s: E = None
        self.v: B = None
        self.u: B = None
        self.txt = txt

a = A("a")
l = B("l")
i = C("i")
d = D("d")
b = E("b")
h = F("h")
n = A("n")

a.p = h
a.w = l
l.t = h
l.o = i
l.w = d
i.t = l
i.y = d
d.p = i
d.w = i
d.y = b
d.q = b
d.s = h
d.u = h
b.y = n
h.r = l
h.v = l
h.u = l
h.t = n
h.s = b
n.p = h
n.w = l
assert h.t.w.o.y.y.txt == "b"