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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: C = None
        self.s: D = None
        self.p: A = None
        self.v: D = None
        self.z: 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.y: F = None
        self.z: A = None
        self.r: F = None
        self.o: C = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: C = None
        self.s: D = None
        self.p: A = None
        self.v: D = None
        self.z: 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.y: F = None
        self.z: A = None
        self.r: F = None
        self.o: C = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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