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

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

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

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

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

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

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

e.w = n
e.x = n
e.u = b
f.q = j
b.s = a
d.s = f
d.x = a
d.w = n
a.p = e
n.t = d
n.q = j
k.s = a
j.s = f
j.x = a
j.w = n
assert a.p.w.t.s.q.x.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

e.w = n
e.x = n
e.u = b
f.q = j
b.s = a
d.s = f
d.x = a
d.w = n
a.p = e
n.t = d
n.q = j
k.s = a
j.s = f
j.x = a
j.w = n
assert a.p.w.t.s.q.x.p.u.txt == "b"