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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: D = None
        self.u: E = None
        self.w: F = None
        self.s: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.r: A = None
        self.z: F = None
        self.t: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: D = None
        self.u: E = None
        self.w: F = None
        self.s: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.r: A = None
        self.z: F = None
        self.t: F = None
        self.txt = txt

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

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