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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: A = None
        self.p: F = None
        self.x: E = None
        self.q: E = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: F = None
        self.t: G = None
        self.w: F = None
        self.x: B = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.y: E = None
        self.v: D = None
        self.txt = txt

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

d = A("d")
f = B("f")
b = C("b")
j = D("j")
n = E("n")
m = F("m")
e = G("e")
k = D("k")

d.r = m
d.y = n
d.v = b
d.s = e
d.w = k
f.y = j
f.r = m
f.x = b
f.z = k
b.o = f
b.w = d
b.y = d
b.p = m
b.x = n
b.q = n
j.o = d
j.y = f
j.x = n
j.s = e
n.z = k
n.s = m
n.w = m
n.t = e
n.x = f
n.u = f
m.p = j
m.v = j
m.o = b
m.y = n
e.s = m
e.z = m
e.o = d
e.q = d
e.r = j
e.t = b
e.y = b
k.o = d
k.y = f
k.x = n
k.s = e
assert f.y.s.s.y.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: E = None
        self.v: C = None
        self.s: G = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: A = None
        self.p: F = None
        self.x: E = None
        self.q: E = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: F = None
        self.t: G = None
        self.w: F = None
        self.x: B = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.y: E = None
        self.v: D = None
        self.txt = txt

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

d = A("d")
f = B("f")
b = C("b")
j = D("j")
n = E("n")
m = F("m")
e = G("e")
k = D("k")

d.r = m
d.y = n
d.v = b
d.s = e
d.w = k
f.y = j
f.r = m
f.x = b
f.z = k
b.o = f
b.w = d
b.y = d
b.p = m
b.x = n
b.q = n
j.o = d
j.y = f
j.x = n
j.s = e
n.z = k
n.s = m
n.w = m
n.t = e
n.x = f
n.u = f
m.p = j
m.v = j
m.o = b
m.y = n
e.s = m
e.z = m
e.o = d
e.q = d
e.r = j
e.t = b
e.y = b
k.o = d
k.y = f
k.x = n
k.s = e
assert f.y.s.s.y.t.o.txt == "d"