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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: G = None
        self.x: D = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: D = None
        self.t: B = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

j = A("j")
e = B("e")
m = C("m")
g = D("g")
l = E("l")
n = F("n")
i = G("i")
a = E("a")

j.t = e
j.u = n
e.w = l
e.t = i
e.q = i
e.x = g
m.o = n
m.q = e
m.p = e
g.w = a
g.v = j
g.u = j
l.q = g
l.w = i
n.u = g
i.y = j
i.q = g
i.u = g
i.t = e
i.o = e
a.q = g
a.w = i
assert l.q.v.u.u.w.q.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: G = None
        self.x: D = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: D = None
        self.t: B = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

j = A("j")
e = B("e")
m = C("m")
g = D("g")
l = E("l")
n = F("n")
i = G("i")
a = E("a")

j.t = e
j.u = n
e.w = l
e.t = i
e.q = i
e.x = g
m.o = n
m.q = e
m.p = e
g.w = a
g.v = j
g.u = j
l.q = g
l.w = i
n.u = g
i.y = j
i.q = g
i.u = g
i.t = e
i.o = e
a.q = g
a.w = i
assert l.q.v.u.u.w.q.w.q.txt == "g"