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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: C = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: F = None
        self.u: E = None
        self.w: C = None
        self.txt = txt

e = A("e")
h = B("h")
d = C("d")
f = D("f")
k = E("k")
n = F("n")
m = F("m")

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: C = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: F = None
        self.u: E = None
        self.w: C = None
        self.txt = txt

e = A("e")
h = B("h")
d = C("d")
f = D("f")
k = E("k")
n = F("n")
m = F("m")

e.v = n
e.o = h
e.p = k
e.y = d
h.v = k
h.t = k
h.p = e
h.z = e
h.u = f
d.y = h
d.x = h
d.u = k
f.z = k
f.q = d
f.t = d
k.t = h
k.y = e
n.p = e
n.o = m
n.u = k
n.w = d
m.p = e
m.o = n
m.u = k
m.w = d
assert h.u.q.u.t.z.txt == "e"