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

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.o: B = None
        self.y: C = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.o: B = None
        self.y: C = None
        self.r: F = None
        self.txt = txt

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

c.s = b
c.v = k
c.y = k
c.w = h
c.r = l
m.z = d
m.r = b
l.w = i
d.x = b
d.z = m
k.q = h
k.o = l
h.u = m
j.t = m
j.o = m
j.v = d
j.y = l
j.r = h
i.t = m
i.o = m
i.v = d
i.y = l
i.r = h
b.x = d
b.z = m
assert c.s.x.x.x.x.x.z.r.x.txt == "d"