class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

a = A("a")
n = B("n")
m = C("m")
k = D("k")
l = E("l")
g = F("g")
e = F("e")
b = A("b")

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

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

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

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

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

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

a = A("a")
n = B("n")
m = C("m")
k = D("k")
l = E("l")
g = F("g")
e = F("e")
b = A("b")

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