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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: G = None
        self.o: C = None
        self.u: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: G = None
        self.o: C = None
        self.u: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

c.w = l
c.p = l
c.u = e
c.r = e
c.z = m
c.x = h
m.r = d
m.s = d
m.o = l
m.u = e
l.o = b
l.r = c
e.r = l
e.v = h
h.r = l
h.s = m
b.o = l
d.s = h
d.u = b
assert c.w.o.o.r.txt == "c"