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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: D = None
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: D = None
        self.u: F = None
        self.q: C = None
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: D = None
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: D = None
        self.u: F = None
        self.q: C = None
        self.w: C = None
        self.txt = txt

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

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