class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.u: F = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.u: F = None
        self.s: B = None
        self.txt = txt

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

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

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

i.r = g
i.u = g
i.v = d
d.r = h
d.v = h
d.y = n
g.y = i
g.r = n
g.t = e
g.v = e
n.o = h
n.t = g
n.u = e
n.s = d
h.y = e
e.o = h
e.w = h
e.r = h
e.v = i
e.x = n
e.t = g
assert g.y.v.v.y.t.t.txt == "e"