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

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

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

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

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

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

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

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

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

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

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

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

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

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

b.s = n
b.q = n
b.p = a
i.w = e
h.w = e
h.o = i
h.y = i
a.t = h
a.q = n
n.w = e
n.q = a
n.s = h
n.u = i
e.y = n
e.p = n
j.s = n
j.q = n
j.p = a
assert b.p.q.w.y.u.w.y.txt == "n"