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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: B = None
        self.s: F = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

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

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

h = A("h")
n = B("n")
d = C("d")
k = D("k")
f = E("f")
i = F("i")
c = A("c")

h.s = i
h.w = i
h.q = n
h.z = n
h.y = f
n.v = h
n.w = i
n.z = d
n.x = f
n.r = f
n.y = c
d.t = n
d.y = n
d.x = h
d.v = i
k.u = n
k.q = n
k.w = n
k.s = i
k.t = i
f.q = i
f.z = i
f.v = h
f.y = h
f.o = n
i.v = n
i.u = f
c.s = i
c.w = i
c.q = n
c.z = n
c.y = f
assert c.s.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: F = None
        self.q: B = None
        self.z: B = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: B = None
        self.s: F = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

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

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

h = A("h")
n = B("n")
d = C("d")
k = D("k")
f = E("f")
i = F("i")
c = A("c")

h.s = i
h.w = i
h.q = n
h.z = n
h.y = f
n.v = h
n.w = i
n.z = d
n.x = f
n.r = f
n.y = c
d.t = n
d.y = n
d.x = h
d.v = i
k.u = n
k.q = n
k.w = n
k.s = i
k.t = i
f.q = i
f.z = i
f.v = h
f.y = h
f.o = n
i.v = n
i.u = f
c.s = i
c.w = i
c.q = n
c.z = n
c.y = f
assert c.s.v.z.txt == "d"