class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.v: A = None
        self.w: D = None
        self.y: D = None
        self.x: C = None
        self.o: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.r: B = None
        self.t: A = None
        self.y: F = None
        self.z: A = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: A = None
        self.u: G = None
        self.y: D = None
        self.x: D = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.r: B = None
        self.t: A = None
        self.y: F = None
        self.z: A = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: A = None
        self.u: G = None
        self.y: D = None
        self.x: D = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

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

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