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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: E = None
        self.s: A = None
        self.q: A = None
        self.x: C = None
        self.txt = txt

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

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

g = A("g")
j = B("j")
n = C("n")
c = D("c")
i = E("i")
l = F("l")

g.v = j
g.r = j
g.y = j
g.x = c
j.x = l
j.p = g
j.r = g
j.y = n
j.t = n
n.t = i
n.s = i
n.x = l
c.r = n
c.x = n
c.u = i
c.s = g
c.q = g
i.y = c
i.q = j
l.r = i
l.v = n
l.q = j
l.t = c
l.s = g
assert i.q.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: D = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: E = None
        self.s: A = None
        self.q: A = None
        self.x: C = None
        self.txt = txt

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

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

g = A("g")
j = B("j")
n = C("n")
c = D("c")
i = E("i")
l = F("l")

g.v = j
g.r = j
g.y = j
g.x = c
j.x = l
j.p = g
j.r = g
j.y = n
j.t = n
n.t = i
n.s = i
n.x = l
c.r = n
c.x = n
c.u = i
c.s = g
c.q = g
i.y = c
i.q = j
l.r = i
l.v = n
l.q = j
l.t = c
l.s = g
assert i.q.r.v.txt == "j"