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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: A = None
        self.w: A = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: B = None
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

g.o = a
g.x = b
g.w = f
d.y = b
d.u = k
d.r = k
d.w = g
d.v = h
n.r = b
n.t = d
n.z = h
n.u = g
h.w = k
h.x = d
b.o = d
a.y = i
a.q = d
a.u = n
f.o = d
i.w = k
i.x = d
k.o = a
k.x = f
k.w = f
assert k.o.y.w.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: A = None
        self.w: A = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: B = None
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

g.o = a
g.x = b
g.w = f
d.y = b
d.u = k
d.r = k
d.w = g
d.v = h
n.r = b
n.t = d
n.z = h
n.u = g
h.w = k
h.x = d
b.o = d
a.y = i
a.q = d
a.u = n
f.o = d
i.w = k
i.x = d
k.o = a
k.x = f
k.w = f
assert k.o.y.w.w.o.txt == "d"