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

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

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

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

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

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

l = A("l")
d = B("d")
j = C("j")
b = D("b")
m = E("m")
g = F("g")

l.w = g
l.s = g
l.u = g
l.x = b
l.t = b
d.x = l
d.s = j
j.w = l
j.y = d
j.q = b
b.o = m
b.y = j
b.r = j
b.q = l
b.x = l
m.o = b
g.o = l
g.t = j
g.p = d
g.s = d
g.q = m
assert d.s.w.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: F = None
        self.x: D = None
        self.u: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

l = A("l")
d = B("d")
j = C("j")
b = D("b")
m = E("m")
g = F("g")

l.w = g
l.s = g
l.u = g
l.x = b
l.t = b
d.x = l
d.s = j
j.w = l
j.y = d
j.q = b
b.o = m
b.y = j
b.r = j
b.q = l
b.x = l
m.o = b
g.o = l
g.t = j
g.p = d
g.s = d
g.q = m
assert d.s.w.s.s.s.txt == "j"