class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: D = None
        self.s: C = None
        self.z: F = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: E = None
        self.w: B = None
        self.o: A = None
        self.r: E = None
        self.txt = txt

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

n = A("n")
g = B("g")
f = C("f")
l = D("l")
b = E("b")
d = F("d")
e = G("e")

n.o = l
n.w = g
n.y = b
g.v = d
f.p = e
l.x = f
l.t = f
l.y = b
b.x = n
b.o = l
b.v = l
b.s = f
b.z = d
d.u = l
d.t = b
d.r = b
d.w = g
d.o = n
e.w = n
e.u = n
e.v = b
e.p = b
e.o = f
e.x = g
e.s = g
assert g.v.o.o.y.z.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: D = None
        self.s: C = None
        self.z: F = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: E = None
        self.w: B = None
        self.o: A = None
        self.r: E = None
        self.txt = txt

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

n = A("n")
g = B("g")
f = C("f")
l = D("l")
b = E("b")
d = F("d")
e = G("e")

n.o = l
n.w = g
n.y = b
g.v = d
f.p = e
l.x = f
l.t = f
l.y = b
b.x = n
b.o = l
b.v = l
b.s = f
b.z = d
d.u = l
d.t = b
d.r = b
d.w = g
d.o = n
e.w = n
e.u = n
e.v = b
e.p = b
e.o = f
e.x = g
e.s = g
assert g.v.o.o.y.z.w.v.txt == "d"