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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

k.v = h
l.x = i
l.w = k
h.z = l
h.v = i
h.x = i
h.t = m
h.u = m
b.p = i
g.s = c
g.r = m
g.w = i
i.u = k
i.s = j
i.y = l
i.p = b
d.p = i
j.s = g
j.r = k
j.w = i
c.s = g
c.r = k
c.w = i
m.v = h
assert i.u.v.v.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

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