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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: A = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: F = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: A = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: F = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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