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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: B = None
        self.z: B = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

i = A("i")
g = B("g")
m = C("m")
b = D("b")
h = E("h")
k = F("k")

i.z = k
i.x = h
i.w = g
i.s = b
g.r = i
g.q = h
m.v = b
b.u = i
b.r = m
h.x = k
h.s = k
h.p = g
h.z = g
h.y = i
k.t = h
k.y = h
k.p = b
k.v = g
k.r = g
k.x = m
assert k.x.v.u.z.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: E = None
        self.w: B = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: B = None
        self.z: B = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

i = A("i")
g = B("g")
m = C("m")
b = D("b")
h = E("h")
k = F("k")

i.z = k
i.x = h
i.w = g
i.s = b
g.r = i
g.q = h
m.v = b
b.u = i
b.r = m
h.x = k
h.s = k
h.p = g
h.z = g
h.y = i
k.t = h
k.y = h
k.p = b
k.v = g
k.r = g
k.x = m
assert k.x.v.u.z.x.v.txt == "b"