class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: C = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.y: C = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: G = None
        self.x: G = None
        self.o: G = None
        self.u: C = None
        self.txt = txt

i = A("i")
m = B("m")
g = C("g")
n = D("n")
c = E("c")
f = F("f")
j = G("j")
d = G("d")

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.y: C = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: G = None
        self.x: G = None
        self.o: G = None
        self.u: C = None
        self.txt = txt

i = A("i")
m = B("m")
g = C("g")
n = D("n")
c = E("c")
f = F("f")
j = G("j")
d = G("d")

i.s = f
i.t = f
i.x = g
m.s = n
m.t = i
g.y = i
g.v = c
n.r = j
n.u = i
c.p = g
c.y = g
c.q = m
c.v = f
f.y = i
j.w = c
j.s = d
j.x = d
j.o = d
j.u = g
d.w = c
d.s = j
d.x = j
d.o = j
d.u = g
assert n.u.x.v.y.txt == "g"