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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: B = None
        self.p: A = None
        self.t: B = None
        self.s: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: C = None
        self.u: A = None
        self.txt = txt

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

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

n.q = j
n.p = l
n.r = g
c.q = n
c.z = g
g.r = c
g.o = c
g.p = i
g.v = l
g.w = k
g.y = b
j.v = g
j.s = g
j.u = c
j.t = c
j.p = k
j.w = n
l.s = c
l.v = g
l.u = k
i.r = g
k.q = j
k.p = b
k.r = g
b.s = c
b.v = g
b.u = n
assert i.r.y.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: E = None
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: B = None
        self.p: A = None
        self.t: B = None
        self.s: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: C = None
        self.u: A = None
        self.txt = txt

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

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

n.q = j
n.p = l
n.r = g
c.q = n
c.z = g
g.r = c
g.o = c
g.p = i
g.v = l
g.w = k
g.y = b
j.v = g
j.s = g
j.u = c
j.t = c
j.p = k
j.w = n
l.s = c
l.v = g
l.u = k
i.r = g
k.q = j
k.p = b
k.r = g
b.s = c
b.v = g
b.u = n
assert i.r.y.v.r.txt == "c"