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

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

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

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

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

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

l = A("l")
g = B("g")
n = C("n")
i = D("i")
e = E("e")
h = F("h")

l.u = g
l.o = g
l.q = g
l.v = i
l.r = n
l.s = e
g.w = e
g.t = h
g.v = h
g.o = i
n.r = l
n.s = g
n.z = g
n.p = i
i.v = n
e.r = g
e.p = h
e.v = h
e.s = n
h.v = n
h.z = n
h.p = i
h.y = i
h.t = i
h.x = i
assert h.x.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: B = None
        self.q: B = None
        self.v: D = None
        self.r: C = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

l = A("l")
g = B("g")
n = C("n")
i = D("i")
e = E("e")
h = F("h")

l.u = g
l.o = g
l.q = g
l.v = i
l.r = n
l.s = e
g.w = e
g.t = h
g.v = h
g.o = i
n.r = l
n.s = g
n.z = g
n.p = i
i.v = n
e.r = g
e.p = h
e.v = h
e.s = n
h.v = n
h.z = n
h.p = i
h.y = i
h.t = i
h.x = i
assert h.x.v.p.v.txt == "n"