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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: F = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: G = None
        self.r: C = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: G = None
        self.q: G = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: F = None
        self.r: F = None
        self.p: D = None
        self.y: B = None
        self.txt = txt

k = A("k")
n = B("n")
c = C("c")
b = D("b")
i = E("i")
j = F("j")
f = G("f")
h = A("h")
d = G("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: F = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: G = None
        self.r: C = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: G = None
        self.q: G = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: F = None
        self.r: F = None
        self.p: D = None
        self.y: B = None
        self.txt = txt

k = A("k")
n = B("n")
c = C("c")
b = D("b")
i = E("i")
j = F("j")
f = G("f")
h = A("h")
d = G("d")

k.r = c
k.y = j
n.z = j
n.p = h
n.r = i
n.y = b
n.o = b
c.p = b
c.x = b
c.y = b
c.r = j
b.x = c
b.v = j
b.s = d
i.s = f
i.w = f
i.r = c
i.z = b
j.o = b
j.t = f
j.q = f
j.z = h
f.q = j
f.z = j
f.r = j
f.p = b
f.y = n
h.r = c
h.y = j
d.q = j
d.z = j
d.r = j
d.p = b
d.y = n
assert j.o.v.q.q.txt == "j"