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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: B = None
        self.w: B = None
        self.x: C = None
        self.txt = txt

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

m = A("m")
j = B("j")
n = C("n")
k = D("k")
i = E("i")
c = F("c")
h = A("h")

m.y = n
m.z = n
m.x = c
m.p = c
m.u = c
m.q = j
j.o = m
j.r = m
n.z = j
k.x = n
k.w = j
k.q = j
k.y = h
k.p = c
k.u = m
i.v = h
i.t = j
i.w = j
i.x = n
c.y = k
c.w = n
c.r = i
c.q = i
h.y = n
h.z = n
h.x = c
h.p = c
h.u = c
h.q = j
assert j.r.q.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.z: C = None
        self.p: F = None
        self.u: F = None
        self.q: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: B = None
        self.w: B = None
        self.x: C = None
        self.txt = txt

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

m = A("m")
j = B("j")
n = C("n")
k = D("k")
i = E("i")
c = F("c")
h = A("h")

m.y = n
m.z = n
m.x = c
m.p = c
m.u = c
m.q = j
j.o = m
j.r = m
n.z = j
k.x = n
k.w = j
k.q = j
k.y = h
k.p = c
k.u = m
i.v = h
i.t = j
i.w = j
i.x = n
c.y = k
c.w = n
c.r = i
c.q = i
h.y = n
h.z = n
h.x = c
h.p = c
h.u = c
h.q = j
assert j.r.q.r.y.txt == "n"