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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: E = None
        self.s: G = None
        self.y: A = None
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.w: D = None
        self.s: A = None
        self.o: G = None
        self.x: B = None
        self.v: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: E = None
        self.s: G = None
        self.y: A = None
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.w: D = None
        self.s: A = None
        self.o: G = None
        self.x: B = None
        self.v: D = None
        self.txt = txt

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

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

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