class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.t: F = None
        self.y: A = None
        self.s: C = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.v: D = None
        self.r: B = None
        self.x: A = None
        self.q: B = None
        self.txt = txt

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

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

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

c.q = k
c.y = k
c.v = e
c.s = e
c.t = i
c.w = n
f.x = i
f.s = c
e.q = i
e.x = i
m.t = g
m.v = g
m.p = j
m.q = j
m.r = f
m.x = k
n.r = j
i.r = n
i.p = e
i.z = m
i.y = k
g.t = m
g.v = m
g.p = j
g.q = j
g.r = f
g.x = k
k.q = c
k.y = c
k.v = e
k.s = e
k.t = i
k.w = n
j.x = i
j.s = c
assert j.s.s.q.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.t: F = None
        self.y: A = None
        self.s: C = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.v: D = None
        self.r: B = None
        self.x: A = None
        self.q: B = None
        self.txt = txt

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

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

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

c.q = k
c.y = k
c.v = e
c.s = e
c.t = i
c.w = n
f.x = i
f.s = c
e.q = i
e.x = i
m.t = g
m.v = g
m.p = j
m.q = j
m.r = f
m.x = k
n.r = j
i.r = n
i.p = e
i.z = m
i.y = k
g.t = m
g.v = m
g.p = j
g.q = j
g.r = f
g.x = k
k.q = c
k.y = c
k.v = e
k.s = e
k.t = i
k.w = n
j.x = i
j.s = c
assert j.s.s.q.z.p.txt == "j"