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

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

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

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

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

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

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

m.x = c
m.o = d
m.y = d
m.u = l
g.y = b
g.z = m
g.t = m
g.s = d
e.p = a
e.r = d
e.s = h
e.y = g
e.q = b
e.o = m
c.t = b
l.s = m
l.r = a
l.t = a
h.o = b
d.o = e
a.y = b
a.z = m
a.t = m
a.s = h
b.p = a
b.r = d
b.s = d
b.y = g
b.q = e
b.o = m
assert c.t.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: F = None
        self.y: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

m.x = c
m.o = d
m.y = d
m.u = l
g.y = b
g.z = m
g.t = m
g.s = d
e.p = a
e.r = d
e.s = h
e.y = g
e.q = b
e.o = m
c.t = b
l.s = m
l.r = a
l.t = a
h.o = b
d.o = e
a.y = b
a.z = m
a.t = m
a.s = h
b.p = a
b.r = d
b.s = d
b.y = g
b.q = e
b.o = m
assert c.t.q.q.txt == "b"