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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.v: D = None
        self.w: D = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

g.s = f
g.x = f
g.w = m
g.o = m
l.s = f
l.y = f
l.v = d
l.w = d
l.o = d
l.x = m
j.w = l
j.z = b
j.u = k
d.y = g
d.w = j
d.s = m
k.u = g
k.y = m
m.o = k
f.s = g
f.x = g
f.w = m
f.o = m
b.w = l
b.z = j
b.u = k
assert k.u.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.w: F = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.v: D = None
        self.w: D = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

g.s = f
g.x = f
g.w = m
g.o = m
l.s = f
l.y = f
l.v = d
l.w = d
l.o = d
l.x = m
j.w = l
j.z = b
j.u = k
d.y = g
d.w = j
d.s = m
k.u = g
k.y = m
m.o = k
f.s = g
f.x = g
f.w = m
f.o = m
b.w = l
b.z = j
b.u = k
assert k.u.w.o.txt == "k"