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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: A = None
        self.s: D = None
        self.txt = txt

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

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

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

c = A("c")
l = B("l")
h = C("h")
k = D("k")
f = E("f")
e = F("e")
m = E("m")
j = B("j")
i = D("i")

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: A = None
        self.s: D = None
        self.txt = txt

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

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

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

c = A("c")
l = B("l")
h = C("h")
k = D("k")
f = E("f")
e = F("e")
m = E("m")
j = B("j")
i = D("i")

c.y = h
l.v = i
l.z = j
h.w = c
h.t = c
h.s = k
k.o = e
k.y = e
k.v = f
k.x = h
k.p = i
k.t = l
f.x = e
e.o = c
e.r = h
m.x = e
j.v = k
j.z = l
i.o = e
i.y = e
i.v = f
i.x = h
i.p = k
i.t = l
assert j.v.v.x.r.s.p.t.v.v.txt == "f"