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

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

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

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

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

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

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

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

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

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

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

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

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

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

a.w = i
a.t = b
a.r = n
a.x = l
a.v = l
b.x = k
k.w = i
k.s = a
k.t = b
n.t = k
j.x = b
l.z = n
l.y = b
l.q = a
h.t = k
i.x = b
assert h.t.t.x.t.x.t.txt == "b"