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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: F = None
        self.w: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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

b.z = m
b.o = m
b.s = l
b.q = g
b.t = f
b.y = h
g.z = h
g.w = j
g.q = l
g.o = l
g.r = f
g.x = m
f.p = m
f.q = j
f.w = j
f.r = h
h.t = l
l.z = m
l.w = j
l.y = f
j.o = m
j.w = m
j.q = l
j.z = g
m.z = b
m.o = b
m.s = l
m.q = g
m.t = f
m.y = h
assert f.q.q.y.r.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: E = None
        self.q: B = None
        self.t: C = None
        self.o: A = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: F = None
        self.w: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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

b.z = m
b.o = m
b.s = l
b.q = g
b.t = f
b.y = h
g.z = h
g.w = j
g.q = l
g.o = l
g.r = f
g.x = m
f.p = m
f.q = j
f.w = j
f.r = h
h.t = l
l.z = m
l.w = j
l.y = f
j.o = m
j.w = m
j.q = l
j.z = g
m.z = b
m.o = b
m.s = l
m.q = g
m.t = f
m.y = h
assert f.q.q.y.r.t.z.txt == "m"