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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: A = None
        self.r: F = None
        self.t: D = None
        self.u: F = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

a = A("a")
i = B("i")
d = C("d")
c = D("c")
h = E("h")
j = F("j")

a.v = d
a.t = d
a.p = i
a.w = i
a.o = j
a.s = j
i.v = d
i.w = a
i.r = j
i.u = j
i.y = j
i.t = c
d.u = h
d.o = h
c.t = a
c.p = h
c.r = j
c.u = i
h.s = j
h.p = c
h.v = c
h.r = i
h.w = a
j.u = a
assert h.r.w.t.o.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.p: B = None
        self.o: F = None
        self.w: B = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: A = None
        self.r: F = None
        self.t: D = None
        self.u: F = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

a = A("a")
i = B("i")
d = C("d")
c = D("c")
h = E("h")
j = F("j")

a.v = d
a.t = d
a.p = i
a.w = i
a.o = j
a.s = j
i.v = d
i.w = a
i.r = j
i.u = j
i.y = j
i.t = c
d.u = h
d.o = h
c.t = a
c.p = h
c.r = j
c.u = i
h.s = j
h.p = c
h.v = c
h.r = i
h.w = a
j.u = a
assert h.r.w.t.o.w.o.txt == "j"