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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

k.w = g
k.u = e
e.z = k
e.s = n
d.r = k
d.w = n
d.s = n
b.z = d
h.w = j
j.r = k
j.t = k
j.q = k
n.z = k
n.s = e
g.w = j
assert g.w.t.u.s.z.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

k.w = g
k.u = e
e.z = k
e.s = n
d.r = k
d.w = n
d.s = n
b.z = d
h.w = j
j.r = k
j.t = k
j.q = k
n.z = k
n.s = e
g.w = j
assert g.w.t.u.s.z.w.w.txt == "j"