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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: F = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

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

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

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

k.y = e
k.o = i
i.x = k
i.v = j
e.w = h
e.u = h
e.q = k
c.t = d
c.y = j
c.q = j
c.w = e
h.t = j
h.q = i
j.v = k
j.y = d
d.w = h
d.u = h
d.q = k
assert e.q.o.x.o.v.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: F = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

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

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

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

k.y = e
k.o = i
i.x = k
i.v = j
e.w = h
e.u = h
e.q = k
c.t = d
c.y = j
c.q = j
c.w = e
h.t = j
h.q = i
j.v = k
j.y = d
d.w = h
d.u = h
d.q = k
assert e.q.o.x.o.v.v.o.txt == "i"