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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.z: F = None
        self.q: E = None
        self.txt = txt

m = A("m")
j = B("j")
n = C("n")
g = D("g")
b = E("b")
a = F("a")
h = F("h")

m.y = b
m.o = b
j.q = m
j.w = g
j.o = b
n.y = j
g.r = a
g.u = a
g.t = m
g.z = b
b.q = n
b.p = m
b.x = m
a.x = n
a.p = j
a.z = h
a.q = b
h.x = n
h.p = j
h.z = a
h.q = b
assert b.q.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.z: F = None
        self.q: E = None
        self.txt = txt

m = A("m")
j = B("j")
n = C("n")
g = D("g")
b = E("b")
a = F("a")
h = F("h")

m.y = b
m.o = b
j.q = m
j.w = g
j.o = b
n.y = j
g.r = a
g.u = a
g.t = m
g.z = b
b.q = n
b.p = m
b.x = m
a.x = n
a.p = j
a.z = h
a.q = b
h.x = n
h.p = j
h.z = a
h.q = b
assert b.q.y.o.txt == "b"