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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: G = None
        self.u: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: D = None
        self.q: C = None
        self.r: A = None
        self.o: F = None
        self.txt = txt

g = A("g")
i = B("i")
m = C("m")
c = D("c")
k = E("k")
j = F("j")
e = G("e")

g.x = j
g.s = e
g.p = m
g.q = m
g.v = i
i.o = k
i.r = e
i.w = e
i.z = m
i.v = c
i.x = c
m.o = j
c.r = j
c.s = e
c.u = g
k.t = j
j.s = i
j.p = g
j.t = g
j.y = c
j.q = k
e.p = c
e.x = c
e.q = m
e.r = g
e.o = j
assert k.t.q.t.t.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: G = None
        self.p: C = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: G = None
        self.u: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: D = None
        self.q: C = None
        self.r: A = None
        self.o: F = None
        self.txt = txt

g = A("g")
i = B("i")
m = C("m")
c = D("c")
k = E("k")
j = F("j")
e = G("e")

g.x = j
g.s = e
g.p = m
g.q = m
g.v = i
i.o = k
i.r = e
i.w = e
i.z = m
i.v = c
i.x = c
m.o = j
c.r = j
c.s = e
c.u = g
k.t = j
j.s = i
j.p = g
j.t = g
j.y = c
j.q = k
e.p = c
e.x = c
e.q = m
e.r = g
e.o = j
assert k.t.q.t.t.p.o.txt == "j"