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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.s: E = None
        self.q: C = None
        self.r: A = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.s: E = None
        self.q: C = None
        self.r: A = None
        self.p: A = None
        self.txt = txt

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

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

h.z = k
h.q = n
h.v = n
h.x = g
h.r = i
h.u = l
d.v = g
d.s = i
d.z = f
d.w = h
l.v = b
n.u = d
n.s = b
m.w = n
m.v = f
m.s = f
m.q = k
m.r = b
m.p = h
g.z = n
f.w = n
f.v = m
f.s = m
f.q = l
f.r = b
f.p = b
i.v = g
i.s = d
i.z = f
i.w = h
b.z = k
b.u = k
b.q = n
b.v = n
b.x = g
b.r = i
k.v = h
assert n.s.q.u.txt == "d"