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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: G = None
        self.q: E = None
        self.v: C = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: D = None
        self.v: A = None
        self.x: B = None
        self.w: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: G = None
        self.q: E = None
        self.v: C = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: D = None
        self.v: A = None
        self.x: B = None
        self.w: A = None
        self.txt = txt

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

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

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