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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.p: B = None
        self.z: E = None
        self.r: B = None
        self.s: E = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: G = None
        self.o: B = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: B = None
        self.v: F = None
        self.y: C = None
        self.t: C = None
        self.s: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.p: B = None
        self.z: E = None
        self.r: B = None
        self.s: E = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: G = None
        self.o: B = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: B = None
        self.v: F = None
        self.y: C = None
        self.t: C = None
        self.s: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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