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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.y: E = None
        self.v: A = None
        self.z: D = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

e = A("e")
k = B("k")
j = C("j")
m = D("m")
i = E("i")
n = F("n")
b = G("b")

e.u = n
e.w = b
k.x = i
j.p = m
j.s = i
j.z = k
j.q = n
m.o = i
i.r = k
i.v = n
i.u = b
i.z = b
i.s = e
n.w = i
b.r = i
b.y = i
b.s = j
b.v = e
b.z = m
b.t = n
b.w = k
assert n.w.v.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.y: E = None
        self.v: A = None
        self.z: D = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

e = A("e")
k = B("k")
j = C("j")
m = D("m")
i = E("i")
n = F("n")
b = G("b")

e.u = n
e.w = b
k.x = i
j.p = m
j.s = i
j.z = k
j.q = n
m.o = i
i.r = k
i.v = n
i.u = b
i.z = b
i.s = e
n.w = i
b.r = i
b.y = i
b.s = j
b.v = e
b.z = m
b.t = n
b.w = k
assert n.w.v.w.z.txt == "b"