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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

b = A("b")
k = B("k")
g = C("g")
l = D("l")
h = E("h")
i = F("i")
f = B("f")
n = B("n")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

b = A("b")
k = B("k")
g = C("g")
l = D("l")
h = E("h")
i = F("i")
f = B("f")
n = B("n")

b.o = h
b.w = i
b.z = g
b.s = l
k.y = b
k.t = b
g.z = k
l.s = g
l.y = h
l.x = b
h.p = g
i.y = l
i.q = l
i.u = l
i.o = g
i.w = h
i.x = h
f.y = b
f.t = b
n.y = b
n.t = b
assert n.t.w.o.txt == "g"