class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: F = None
        self.o: E = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: F = None
        self.q: C = None
        self.w: B = None
        self.y: A = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: F = None
        self.q: C = None
        self.w: B = None
        self.y: A = None
        self.t: B = None
        self.txt = txt

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

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

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

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