class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: G = None
        self.o: E = None
        self.s: G = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: G = None
        self.w: A = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: E = None
        self.o: B = None
        self.x: E = None
        self.z: E = None
        self.r: D = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: G = None
        self.w: A = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: E = None
        self.o: B = None
        self.x: E = None
        self.z: E = None
        self.r: D = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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