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

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

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

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

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

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

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

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

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

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

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

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

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

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

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