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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: C = None
        self.t: D = None
        self.q: A = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

l.x = e
l.y = e
l.q = i
l.v = a
i.o = a
i.w = a
i.t = m
i.q = l
i.y = e
a.y = l
a.o = i
m.w = d
e.r = f
e.s = g
g.t = f
g.y = m
d.t = f
d.y = m
c.o = a
c.w = a
c.t = m
c.q = l
c.y = f
f.r = e
f.s = d
assert d.y.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: B = None
        self.y: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: C = None
        self.t: D = None
        self.q: A = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

l.x = e
l.y = e
l.q = i
l.v = a
i.o = a
i.w = a
i.t = m
i.q = l
i.y = e
a.y = l
a.o = i
m.w = d
e.r = f
e.s = g
g.t = f
g.y = m
d.t = f
d.y = m
c.o = a
c.w = a
c.t = m
c.q = l
c.y = f
f.r = e
f.s = d
assert d.y.w.y.txt == "m"