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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.txt = txt

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

c.r = h
c.y = h
c.u = g
c.p = l
c.v = l
c.o = f
d.w = f
d.s = f
d.z = f
d.p = g
d.u = c
d.r = l
l.z = d
l.o = d
l.q = f
l.x = g
l.y = e
h.r = e
g.t = d
f.x = l
f.y = l
f.r = e
e.w = f
e.o = h
assert c.v.z.p.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.u: E = None
        self.p: C = None
        self.v: C = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.txt = txt

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

c.r = h
c.y = h
c.u = g
c.p = l
c.v = l
c.o = f
d.w = f
d.s = f
d.z = f
d.p = g
d.u = c
d.r = l
l.z = d
l.o = d
l.q = f
l.x = g
l.y = e
h.r = e
g.t = d
f.x = l
f.y = l
f.r = e
e.w = f
e.o = h
assert c.v.z.p.t.u.txt == "c"