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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.z: G = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: C = None
        self.p: C = None
        self.u: B = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: A = None
        self.txt = txt

d = A("d")
c = B("c")
k = C("k")
h = D("h")
m = E("m")
l = F("l")
a = G("a")

d.r = m
d.o = k
d.u = k
d.y = c
d.v = c
c.s = m
k.r = a
k.w = m
k.u = m
h.v = d
h.r = c
m.p = k
m.y = k
m.z = a
m.w = h
l.w = c
l.u = c
l.z = k
l.p = k
l.o = m
a.o = m
a.q = d
assert c.s.w.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: C = None
        self.y: B = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.z: G = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: C = None
        self.p: C = None
        self.u: B = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: A = None
        self.txt = txt

d = A("d")
c = B("c")
k = C("k")
h = D("h")
m = E("m")
l = F("l")
a = G("a")

d.r = m
d.o = k
d.u = k
d.y = c
d.v = c
c.s = m
k.r = a
k.w = m
k.u = m
h.v = d
h.r = c
m.p = k
m.y = k
m.z = a
m.w = h
l.w = c
l.u = c
l.z = k
l.p = k
l.o = m
a.o = m
a.q = d
assert c.s.w.v.o.txt == "k"