class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: F = None
        self.v: B = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: F = None
        self.y: D = None
        self.t: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: F = None
        self.y: D = None
        self.t: E = None
        self.q: B = None
        self.txt = txt

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

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