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

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

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

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

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

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

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

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

k.z = b
k.u = f
l.x = n
f.t = l
f.v = b
f.p = n
n.s = j
n.y = j
n.u = b
b.p = j
b.w = a
b.y = l
b.v = l
j.t = f
j.z = b
j.x = k
a.w = f
a.t = f
assert b.w.w.p.u.p.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

k.z = b
k.u = f
l.x = n
f.t = l
f.v = b
f.p = n
n.s = j
n.y = j
n.u = b
b.p = j
b.w = a
b.y = l
b.v = l
j.t = f
j.z = b
j.x = k
a.w = f
a.t = f
assert b.w.w.p.u.p.x.z.txt == "b"