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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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