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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

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

g = A("g")
i = B("i")
a = C("a")
c = D("c")
m = E("m")
e = F("e")
b = G("b")
f = C("f")
k = G("k")
h = E("h")

g.q = e
g.y = e
g.u = c
g.x = i
g.s = h
i.z = g
i.x = c
a.v = e
c.q = h
m.q = b
e.u = i
e.o = f
b.w = k
b.r = c
b.v = c
b.t = g
b.x = f
b.u = f
f.v = e
k.w = b
k.r = c
k.v = c
k.t = g
k.x = f
k.u = f
h.q = k
assert k.x.v.u.z.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: D = None
        self.y: F = None
        self.x: B = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

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

g = A("g")
i = B("i")
a = C("a")
c = D("c")
m = E("m")
e = F("e")
b = G("b")
f = C("f")
k = G("k")
h = E("h")

g.q = e
g.y = e
g.u = c
g.x = i
g.s = h
i.z = g
i.x = c
a.v = e
c.q = h
m.q = b
e.u = i
e.o = f
b.w = k
b.r = c
b.v = c
b.t = g
b.x = f
b.u = f
f.v = e
k.w = b
k.r = c
k.v = c
k.t = g
k.x = f
k.u = f
h.q = k
assert k.x.v.u.z.y.o.txt == "f"