class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: B = None
        self.p: G = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: E = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: B = None
        self.s: A = None
        self.q: E = None
        self.r: E = None
        self.v: D = None
        self.txt = txt

k = A("k")
a = B("a")
m = C("m")
e = D("e")
f = E("f")
c = F("c")
b = G("b")
d = G("d")
n = B("n")

k.o = b
k.p = b
k.s = a
k.r = e
a.p = k
a.y = d
m.r = e
e.w = m
e.q = m
e.u = f
f.o = k
c.u = e
c.t = f
c.z = d
b.z = e
b.v = e
b.u = a
b.s = k
b.q = f
b.r = f
d.z = e
d.v = e
d.u = n
d.s = k
d.q = f
d.r = f
n.p = k
n.y = b
assert f.o.p.r.o.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: B = None
        self.p: G = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: E = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: B = None
        self.s: A = None
        self.q: E = None
        self.r: E = None
        self.v: D = None
        self.txt = txt

k = A("k")
a = B("a")
m = C("m")
e = D("e")
f = E("f")
c = F("c")
b = G("b")
d = G("d")
n = B("n")

k.o = b
k.p = b
k.s = a
k.r = e
a.p = k
a.y = d
m.r = e
e.w = m
e.q = m
e.u = f
f.o = k
c.u = e
c.t = f
c.z = d
b.z = e
b.v = e
b.u = a
b.s = k
b.q = f
b.r = f
d.z = e
d.v = e
d.u = n
d.s = k
d.q = f
d.r = f
n.p = k
n.y = b
assert f.o.p.r.o.r.u.txt == "f"