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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.q: D = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: B = None
        self.p: E = None
        self.r: C = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.q: D = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: B = None
        self.p: E = None
        self.r: C = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.txt = txt

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

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

f.z = b
f.x = e
h.r = f
h.o = f
h.u = d
h.q = m
h.s = m
e.t = d
e.y = h
e.o = h
e.p = b
e.r = l
m.p = b
m.s = b
m.v = f
m.o = d
m.z = h
b.w = m
b.q = e
d.y = e
d.t = e
d.w = f
d.o = m
d.q = h
l.t = d
l.y = h
l.o = h
l.p = b
l.r = e
assert m.z.q.o.txt == "d"