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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: B = None
        self.t: C = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

a = A("a")
k = B("k")
m = C("m")
h = D("h")
g = E("g")
l = F("l")
i = C("i")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: B = None
        self.t: C = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

a = A("a")
k = B("k")
m = C("m")
h = D("h")
g = E("g")
l = F("l")
i = C("i")

a.r = i
a.z = m
k.x = g
k.r = l
k.o = l
k.y = a
k.v = h
m.q = l
m.w = l
m.v = i
m.x = g
m.r = k
m.y = h
h.s = l
h.t = g
g.w = k
l.s = h
l.o = k
l.t = m
l.p = i
l.v = g
i.q = l
i.w = l
i.v = m
i.x = g
i.r = k
i.y = h
assert h.s.o.y.r.x.w.txt == "k"