class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: A = None
        self.o: D = None
        self.txt = txt

g = A("g")
i = B("i")
m = C("m")
l = D("l")
c = E("c")
a = F("a")
k = C("k")

g.u = l
g.x = k
i.u = c
i.t = a
i.o = l
m.u = c
m.t = k
l.u = i
l.t = i
l.q = c
l.y = a
c.u = l
c.w = l
c.x = l
c.s = m
c.t = i
a.s = i
a.p = g
a.o = l
k.u = c
k.t = m
assert l.t.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: A = None
        self.o: D = None
        self.txt = txt

g = A("g")
i = B("i")
m = C("m")
l = D("l")
c = E("c")
a = F("a")
k = C("k")

g.u = l
g.x = k
i.u = c
i.t = a
i.o = l
m.u = c
m.t = k
l.u = i
l.t = i
l.q = c
l.y = a
c.u = l
c.w = l
c.x = l
c.s = m
c.t = i
a.s = i
a.p = g
a.o = l
k.u = c
k.t = m
assert l.t.o.y.txt == "a"