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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: A = None
        self.r: E = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: C = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.x: C = None
        self.q: F = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: E = None
        self.t: C = None
        self.v: A = None
        self.w: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: A = None
        self.r: E = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: C = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.x: C = None
        self.q: F = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: E = None
        self.t: C = None
        self.v: A = None
        self.w: A = None
        self.txt = txt

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

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