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

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

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

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

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

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

m = A("m")
d = B("d")
c = C("c")
a = D("a")
i = E("i")
n = F("n")
f = B("f")

m.x = i
m.t = c
m.z = a
m.s = n
d.o = i
c.r = m
c.v = n
c.t = a
c.q = a
c.s = a
c.u = d
a.q = m
a.o = m
a.z = n
a.x = c
i.s = d
n.p = m
n.r = a
n.z = a
n.t = c
n.s = i
f.o = i
assert a.q.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: C = None
        self.z: D = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

m = A("m")
d = B("d")
c = C("c")
a = D("a")
i = E("i")
n = F("n")
f = B("f")

m.x = i
m.t = c
m.z = a
m.s = n
d.o = i
c.r = m
c.v = n
c.t = a
c.q = a
c.s = a
c.u = d
a.q = m
a.o = m
a.z = n
a.x = c
i.s = d
n.p = m
n.r = a
n.z = a
n.t = c
n.s = i
f.o = i
assert a.q.x.s.txt == "d"