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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.x: D = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: A = None
        self.u: A = None
        self.r: D = None
        self.y: B = None
        self.txt = txt

d = A("d")
g = B("g")
b = C("b")
e = D("e")
k = E("k")
a = F("a")
h = G("h")
j = E("j")
f = D("f")

d.r = e
g.x = d
g.y = d
g.z = k
b.q = a
b.v = a
b.u = d
b.t = d
b.z = f
b.y = h
b.x = h
e.y = k
e.w = f
e.x = f
e.t = a
k.z = f
k.r = b
a.s = j
a.o = b
a.z = e
a.v = g
h.t = d
h.p = d
h.u = d
h.r = e
h.y = g
j.z = f
j.r = b
f.y = k
f.w = e
f.x = e
f.t = a
assert j.r.t.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.x: D = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: A = None
        self.u: A = None
        self.r: D = None
        self.y: B = None
        self.txt = txt

d = A("d")
g = B("g")
b = C("b")
e = D("e")
k = E("k")
a = F("a")
h = G("h")
j = E("j")
f = D("f")

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