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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: D = None
        self.w: C = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: D = None
        self.w: C = None
        self.t: F = None
        self.txt = txt

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

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

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

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